public class RobotAleatoire extends Robot
{
	public RobotAleatoire(Labyrinthe lab)
	{
		super(lab, new int[]{Labyrinthe.UP, Labyrinthe.RIGHT, Labyrinthe.DOWN, Labyrinthe.LEFT});
	}

	public int findExit()
	{
		int ct=0, sel; //moves done
		while (!laby.isExit()) //not found (yet)
		{
			while (true)
			{
				sel = (int)(Math.random()*4);
				if (laby.go(preferences[sel]))
					break; //found a way to move
			}
			ct++;
		}
		return ct;
	}
}
